package com.itheima02.day08;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * @author 刘全
 * @date 2021/7/24
 */
public class Test2 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        Iterator<String> it = list.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
    }
}
